/*
 * @Author: KKKKKK
 * @Date: 2021-01-10 12:08:35
 * @LastEditors: KKKKKK
 * @LastEditTime: 2021-01-10 12:08:35
 */
import axios from './config'
import url from './url'
const baseUrl = process.env.VUE_APP_BASE_URL

/* 需求 */
// 新增需求
const requirementsCreate = (params) => axios.post(baseUrl + url.requirements.create, params)

// 删除需求
const requirementsDelete = (id) => axios.delete(baseUrl + url.requirements.delete + `/${id}`)

// 修改需求
const requirementsUpdate = (params, id) => axios.post(baseUrl + url.requirements.update + `/${id}`, params)

// 获取某个需求
const requirementsLoad = (id) => axios.get(baseUrl + url.requirements.load + `/${id}`)

// 获取需求列表
const requirementsPage = (params) => axios.get(baseUrl + url.requirements.page, { params })

export default {
    requirementsCreate,
    requirementsDelete,
    requirementsUpdate,
    requirementsLoad,
    requirementsPage,
}